package com.hss.test

/**
 * Created by Administrator on 2017/6/6.
 */
class Arr {
}

fun  main(args:Array<String>){
    //    var arr1 = Array(5,{i->(i*i).toString()})
//    println(arr1[2])

    var arr :Array<Int> = arrayOf(1,2,34,56,8)
//    for (item :Int in arr){
//        println(item)
//    }

//    for (i in arr.indices){
//        println(arr[i])
//    }

//    for ((index,value) in arr.withIndex()){
//        println("index = "+index + "   value = "+value)
//    }

//    arr.forEach {
//        println(it)
//    }

     arr.forEach (fun(value :Int){println(value)})

}